feat(chip): add outlined version - #2307
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces an outlined visual style for igc-chip, wiring it through the component API, Storybook, tests, and theme styles so consumers can opt into an outlined appearance via a new outlined boolean attribute/property.
Changes:
- Added a new reflected boolean
outlinedproperty toIgcChipComponent, plus Storybook controls and examples. - Extended shared + theme-specific SCSS to style outlined chips across light/dark and theme variants (material/bootstrap/fluent/indigo).
- Added a unit test for toggling the new
outlinedproperty.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| stories/chip.stories.ts | Adds outlined control/args and showcases outlined variants/states in stories. |
| src/components/chip/chip.ts | Introduces the new reflected outlined boolean property on the component. |
| src/components/chip/chip.spec.ts | Adds a unit test for toggling outlined (but still missing required a11y audit coverage). |
| src/components/chip/themes/chip.base.scss | Adjusts base chip styling and adds outlined variant behavior in base styles. |
| src/components/chip/themes/shared/chip.common.scss | Adds core outlined state styling (background/text/border + hover/focus/disabled) via theme tokens. |
| src/components/chip/themes/shared/chip.indigo.scss | Updates indigo shared behaviors (focus shadow tokens, disabled/selected adjustments). |
| src/components/chip/themes/shared/chip.fluent.scss | Adds fluent shared overrides for outlined variant backgrounds. |
| src/components/chip/themes/shared/chip.bootstrap.scss | Adds bootstrap shared overrides for outlined variants (hover/focus behavior). |
| src/components/chip/themes/light/chip.material.scss | Adds light material outlined-variant border/text overrides. |
| src/components/chip/themes/light/chip.indigo.scss | Adds light indigo outlined-variant behaviors + warning disabled color adjustment. |
| src/components/chip/themes/light/chip.fluent.scss | Adds light fluent outlined-variant border/text + hover/focus backgrounds. |
| src/components/chip/themes/light/chip.bootstrap.scss | Adds light bootstrap outlined-variant border/text overrides. |
| src/components/chip/themes/dark/chip.material.scss | Adds dark material outlined-variant border/text overrides. |
| src/components/chip/themes/dark/chip.indigo.scss | Adds dark indigo outlined-variant behaviors + warning disabled color adjustment. |
| src/components/chip/themes/dark/chip.fluent.scss | Adds dark fluent outlined-variant border/text + hover/focus backgrounds. |
| src/components/chip/themes/dark/chip.bootstrap.scss | Adds dark bootstrap outlined-variant border/text overrides. |
|
@adrianptrv |
He's essentially changing some of the theme CSS variables. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated no new comments.
Suppressed comments (3)
stories/chip.stories.ts:85
- The args interface doc for
outlinedshould follow the same “Whether …” phrasing used across the codebase for boolean properties.
/** Defines if the chip is outlined or not. */
outlined: boolean;
src/components/chip/chip.ts:81
- The new
outlinedproperty JSDoc uses the older “Defines if …” phrasing and omits@default. Most components document booleans as “Whether …” and include an explicit default (e.g.src/components/icon/icon.ts:109-114). Aligning this keeps generated docs and Storybook descriptions consistent.
/**
* Defines if the chip is outlined or not.
*
* @attr
*/
stories/chip.stories.ts:41
- Storybook argTypes description for
outlinedshould match the component’s boolean-doc convention (“Whether …”), otherwise the generated docs read awkwardly/inconsistently.
This issue also appears on line 84 of the same file.
outlined: {
type: 'boolean',
description: 'Defines if the chip is outlined or not.',
control: 'boolean',
table: { defaultValue: { summary: 'false' } },
},
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 19 changed files in this pull request and generated no new comments.
Suppressed comments (1)
src/components/chip/themes/shared/chip.indigo.scss:34
- The
:host([selected]) button[disabled] { opacity: .4; }rule applies to all selected+disabled chips, includingvariant='primary'. This conflicts with the later rules that intentionally avoid adding opacity for the primary filled variant (see the@if $variant != 'primary' { opacity: .4; }branch in the disabled variant mixin), and will makeselected + variant='primary' + disabledunexpectedly semi-transparent.
:host([selected]) button[disabled] {
opacity: .4;
}
simeonoff
left a comment
There was a problem hiding this comment.
The biggest concern I have with this PR is that colors for various states are hardcoded in the implementation of the component theme and not consumed from the component schema. For instance, some of the colors for the focus/hover states for background are hard-coded here. What is the reason for that?
| border-color: color($variant-color, $border-shade); | ||
| color: contrast-color(gray, 100); |
There was a problem hiding this comment.
Interesting approach, I've thought those colors should be derived from the component schema, not hand written here.
|
|
||
| &:focus { | ||
| background: color($variant-color, 800, .50); | ||
| } | ||
|
|
||
| &:hover { | ||
| background: color($variant-color, 600, .20); | ||
| } |
There was a problem hiding this comment.
Same comment as the one above.
| background: color($variant-color, 500, .30); | ||
| } @else { | ||
| background: color($variant-color, 400, .30); | ||
| } |
There was a problem hiding this comment.
Same comment as the one above.
Description
Adding a new outlined version of the Chip. All the new styles from the handoff have been applied.
Needs to be tested together with this theming PR: #592
Type of Change
Related Issues
Closes IgniteUI/igniteui-theming#591
Testing
All the new changes can be tested and compared to the handoff through the Chip stories.
Checklist